package jeye.util;

import java.io.IOException;
import java.io.InputStream;

import javax.microedition.io.Connector;

import jeye.client.util.HttpClientConnector;
import jeye.client.util.URLBuilder;

public class HttpConnector implements HttpClientConnector {
	
	private String connectionURL;
	
	public HttpConnector(String connectionUrl) {
		this.connectionURL = connectionUrl;
	}

	public URLBuilder getConnectionURL() {
		return new URLBuilder(connectionURL);
	}

	public InputStream getInputStream(URLBuilder url) throws IOException {
		return Connector.openInputStream(url.toString());
	}

	public InputStream getInputStream() throws IOException {
		return Connector.openInputStream(connectionURL);
	}

}
